<?php
namespace lemo\api;

use think\facade\Request;

trait Send
{

	/**
	 * 返回成功
	 */
	public static function returnMsg($message = '',$data = [])
	{	
        $return['code'] = 0;
        $return['msg'] = $message;
        $return['data'] = is_array($data) ? $data : ['info'=>$data];
        return json($return);
	}

    /**
     * 返回成功
     */
    public static function returnErr($message = '',$data = [])
    {
        $return['code'] = -1;
        $return['msg'] = $message;
        $return['data'] = is_array($data) ? $data : ['info'=>$data];
        return json($return);
    }
}

